def make_chocolate(small, big, goal):
  if goal <= big*5 + small:
    if big*5 > goal:
      if small >= goal - (goal//5)*5:
        return goal - (goal//5)*5
      if small < goal - (goal//5)*5:
        return -1
    if big*5 == goal:
      return 0
    if big*5 < goal:
      return goal-big*5
  else:
    return -1